/*
 * @(#) $Header$
 *
 * Copyright (C) 2007  Forklabs Daniel Léonard
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package ca.forklabs.media.jai;

/**
 * Interface {@code ImageFunction3D} represents a collection of image that are
 * rendered according to a ternary function <em>f(x, y, z)</em>.
 *
 * @author   <a href="mailto:forklabs at gmail.com?subject=ca.forklabs.media.jai.ImageFunction3D">Daniel Léonard</a>
 * @version $Revision$
 */
public interface ImageFunction3D {

   /**
    * Determines if pixels are complex or not.
    * @return   {@code true} if the pixels are complex, {@code false} otherwise.
    */
   public boolean isComplex();

   /**
    * Returns the number of bands for each image.
    * @return   the number of bands.
    */
   public int getNumBands();

   /**
    * Gets one band of one image.
    * @param   band   the bamd.
    * @param   slice   the image.
    * @param   dimX   the size of the band in the <em>x</em> dimension.
    * @param   dimY   the size of the band in the <em>y</em> dimension.
    * @param   dimZ   the size of the band in the <em>z</em> dimension.
    * @param   real   a pre-allocated float array of length at least
    *                 <em>dimX * dimY</em> in which the real parts will be
    *                 returned.
    * @param   imag   a pre-allocated float array of length at least
    *                 <em>dimX * dimY</em> in which the imaginary parts will be
    *                 returned, {@code null} if {@link #isComplex()} returns
    *                 {@code false}.
    */
   public void getBand(int band, int slice,
                       int dimX, int dimY, int dimZ,
                       float[] real, float[] imag);

   /**
    * Gets one band of one image.
    * @param   band   the bamd.
    * @param   slice   the image.
    * @param   dimX   the size of the band in the <em>x</em> dimension.
    * @param   dimY   the size of the band in the <em>y</em> dimension.
    * @param   dimZ   the size of the band in the <em>z</em> dimension.
    * @param   real   a pre-allocated float array of length at least
    *                 <em>dimX * dimY</em> in which the real parts will be
    *                 returned.
    * @param   imag   a pre-allocated float array of length at least
    *                 <em>dimX * dimY</em> in which the imaginary parts will be
    *                 returned, {@code null} if {@link #isComplex()} returns
    *                 {@code false}.
    */
   public void getBand(int band, int slice,
                       int dimX, int dimY, int dimZ,
                       double[] real, double[] imag);

   }
